#pragma once

#include <jlib/jlib.h>
#include <cuda_runtime_api.h>
#include <vector>


#define cuda_debug_assert(err) debug_assert(err == cudaSuccess, "CUDA-ERROR:%s:%d:%s", __FILE__, __LINE__, cudaGetErrorString(err))
#define cuda_abort_assert(err) abort_assert(err == cudaSuccess, "CUDA-ERROR:%s:%d:%s", __FILE__, __LINE__, cudaGetErrorString(err))


namespace cuda {


struct Dev {

  explicit Dev (int index) noexcept;

  void log () noexcept;

private:
  cudaDeviceProp _prop;
};


struct Env {

  Env () noexcept;

  void log () noexcept;

private:
  std::vector<Dev> _devsces;
};


}
